package com.liaogui.observer;

/**
 * @author liaogui
 * @date 2025/2/4 14:42
 */
public class Test {
    public static void main(String[] args) {
        // 被观察者
        ConcreteSubject concreteSubject = new ConcreteSubject();
        // 添加三个观察者
        concreteSubject.addObserver(new EmailObserver());
        concreteSubject.addObserver(new IMMessageObserver());
        concreteSubject.addObserver(new MobileNoObserver());
        // 状态发送变化
        concreteSubject.setState(1);

    }
}
